package com.example.day06;

public class StringBufferTest {
    public static void main(String[] args) {
        StringBuffer stringBuffer = new StringBuffer("hello,");//String -> StringBuffer
        String s = stringBuffer.toString(); //StringBuffer -> String

        stringBuffer.append(" world! ");
        System.out.println(stringBuffer);

        stringBuffer.delete(5, 7); // helloworld!
        System.out.println(stringBuffer);

        stringBuffer.insert(5,",");
        System.out.println(stringBuffer);

        stringBuffer.setCharAt(0, 'H');
        System.out.println(stringBuffer);

        stringBuffer.reverse();
        System.out.println(stringBuffer);
    }
}
